FROM openjdk:8-jdk
RUN echo "Asia/Shanghai" > /etc/timezone
ENV LANG C.UTF-8
ENV JAVA_OPTS "-Xms128m -Xmx512m -XX:NewRatio=4 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/logs"
ENV JAVA_JMX "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.rmi.port=8090 -Dcom.sun.management.jmxremote.port=8090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=piece-cloud.com"
EXPOSE 8080

VOLUME /tmp
COPY simsun.ttc /usr/share/fonts/
ADD target/*.jar  /app.jar
RUN bash -c 'touch /app.jar'
CMD java $JAVA_OPTS $JAVA_JMX '-Dfile.encoding=utf-8' '-Dspring.profiles.active=prod' '-Dserver.port=8080' -jar /app.jar
